package com.common.util;

public enum ResultCodeEnum {
    LOGIN_SUCCESS(200, "用户登录成功"),
    LOGIN_BLACKLIST(401, "此token列入黑名单"),
    LOGIN_OVERDUE(401, "登录失败"),

    LOGIN_NEED_AUTHORITIES(401, "用户未登录"),

    NO_ACCESS(403, "用户无权访问"),
    LOGOUT_SUCCESS(205, "用户登出成功"),
    RESULT_SUCCESS(200, "成功"),
    RESULT_ERROR(400, "失败"),
    RESULT_ERROR_PWD(400, "输入账号密码错误");

    private Integer code;
    private String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ResultCodeEnum parse(int code) {
        ResultCodeEnum[] values = values();
        ResultCodeEnum[] var2 = values;
        int var3 = values.length;

        for (int var4 = 0; var4 < var3; ++var4) {
            ResultCodeEnum value = var2[var4];
            if (value.getCode() == code) {
                return value;
            }
        }

        throw new RuntimeException("Unknown code of ResultEnum");
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
